package com.hqyj.ctxp.controller;

import com.hqyj.ctxp.pojo.User;
import com.hqyj.ctxp.pojo.UserInfo;
import com.hqyj.ctxp.service.UserInfoService;
import com.hqyj.ctxp.utils.JwtUtils;
import com.hqyj.ctxp.utils.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    //展示用户个人信息
    @GetMapping("/showInfo/{userNo}")
    public ResultInfo showInfo(@PathVariable Integer userNo){
        return userInfoService.selectUserById(userNo);
    }


    //修改个人信息
    @PutMapping("/updateInfo")
    public ResultInfo updateInfo(@RequestBody UserInfo userInfo){
        return userInfoService.updateUserInfo(userInfo);
    }


}
